﻿using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using myapp_common;
using myweb.Models;
using myweb.Services;
using myweb.Services.Impl;

// For more information on enabling MVC for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860

namespace myweb.Controllers
{
    [Route("api/mytest")]
    public class MyController : ControllerBase
    {
        private readonly ILogger<MyController> _logger;
        private readonly UserService _userService;
        public MyController(ILogger<MyController> logger,UserService userService)
        {

            _logger = logger;
            _userService = userService;
        }

        [HttpGet]
        public ResultValueObject<UserInfo> Index()
        {
            _logger.LogInformation("开始调用接口");
            return _userService.addUser();
        }
    }
}
